﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'PRC_TB_ALERTS_TASKS_USERS_SE')
	BEGIN
		DROP  Procedure  dbo.PRC_TB_ALERTS_TASKS_USERS_SE
	END

GO

CREATE Procedure dbo.PRC_TB_ALERTS_TASKS_USERS_SE
	(
		@TAT_ID int
	)

AS

select
	TU_ID,
	TU_NAME
from TB_ALERTS_TASKS_USERS
	inner join TB_USER
		on TATU_USER_ID = TU_ID
where TATU_ALERT_TASK_ID = @TAT_ID
order by TU_NAME

GO

GRANT EXEC ON dbo.PRC_TB_ALERTS_TASKS_USERS_SE TO PUBLIC

GO

